package com.powernobug.controller;

import com.powernobug.bean.vo.BaseRespVo;
import com.powernobug.service.HomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: 肖云戈
 * @CreateTime: 2024-08-30
 * @Description:
 */
@RestController
@RequestMapping("wx/home")
public class HomeController {

    @Autowired
    HomeService homeService;

    @RequestMapping("index")
    public BaseRespVo<Object> index() {
        // 无请求参数，直接返回即可
        return BaseRespVo.okList(homeService.getHomeIndexData());
    }


////    @GetMapping("index")
//    @RequestMapping(
//            // 限定请求的URI（在类上时是窄化请求）
//            value = "temp",
//            // 限定请求方式为GET
//            method = RequestMethod.GET,
//            // 限定请求参数为username和password（多个条件时为并集）
//            params = {"username", "password"}
//            // 限定请求头为 Accept=application/json 的请求
//            // headers = {"Accept=application/json"},
//            // 限定请求的内容类型为 application/json
//            // consumes = {"image/jpeg"},
//            // 限定客户端能响应的内容类型为 application/json
//            // produces = "application/json;charset=utf-8"
//    )
//    // @ResponseBody
//    public BaseRespVo<Object> temp(String username, String password) {
//        System.out.println("username = " + username);
//        System.out.println("password = " + password);
//        MarketGoods marketGoods = new MarketGoods();
//        marketGoods.setBrief(username);
//        marketGoods.setDetail(password);
//        return BaseRespVo.okList(marketGoods);
//    }
}
